import request from '../utils/request'

export const getGameListService = () => request.get('/games')

//获取对应游戏id的游戏详情
export const getGameDetailService = (id) => request.get('/games/' + id)

//获取对应商家id的游戏列表
export const getGameListBySellerService = (busId) => request.get(`/games/bus/${busId}`)

//新增游戏
export const addGameService = (data) => request.post('/games', data)

//搜索游戏
export const searchGameService = (data) => {
  return request.get(`/games/search?game_name=${data.game_name}&category=${data.category}`, data)
}

//获取审批通过的游戏列表，spzt=1
export const getApprovedGameListService = () => request.get('/games/spzt/1')

//根据id更新游戏是否启用状态
export const updateGameStatusService = (data) => request.post('/games/change/sfqy', data)
